initialize
Create an object from Predis.ai SDK.
Usage
const predis = new window.Predis();
predis.initialize({
appId: "YOUR_APP_ID",
embedToken: "SSO_TOKEN", // optional, to enable SSO
customAssets: [{ url: "some_image_url" }], // optional, to pass images inside the Predis.ai post generator
mode: window.Predis.modes.SIMPLE //to define if you want the detailed more or minimal mode,
brandDetails: {
name: "Your Brand Name",
logo_url: "https://predis.ai/assets/img/predis_logo-min.webp",
brand_hashtags: "#preidsai",
brand_website: "somewebsite.ai",
brand_handle: "@predisai",
brand_colors: ["#296bd6", "#ff71ab"]
}
});
Parameters
Name | Description | Type | Required |
---|---|---|---|
appId | App ID received from Predis.ai account. | String | yes |
embedToken | A token generated with the provided SSO key to enable Single Sign-on | String | no |
customAssets | An array of objects with image URLs. If passed in the config, these images show up in the post generation flow and can be used to generate a post. | Array | no |
mode | If you pass "window.Predis.modes.SIMPLE", the popup only show the create flow and library view. This is ideal for most use cases. Passing "window.Predis.modes.DETAILED" will show the more product features like Competitor analysis, Idea Labs etc. This is defaulted to "window.Predis.modes.SIMPLE". | String | no |
brandDetails.name | Name associated with the brand. This will show up on the UI In places where brand name is shown. | String | no |
brandDetails.logo_url | Logo associated with the brand. This will show up on the UI In places where brand name is shown. | String | no |
brandDetails.brand_hashtags | These hashtags will be appended to the AI generated caption. You can use it to add any text if needed. | String | no |
brandDetails.brand_website | The Brand website will be shown on AI-generated creatives. This is shown only if the design has space for website text. | String | no |
brandDetails.brand_handle | The Brand handle will be shown on AI-generated creatives. This is shown only if the design has space for the handle name text. | String | no |
brandDetails.brand_colors | The AI-generated creatives will be generated using these colors. Maximum 5 colors can be passed here | Array | no |
show_onboarding | Pass this as true if you want users to experience the onboarding flow when they use the SDK for the 1st time. | boolean | no |
whiteLabelLogo | Pass your logo URL to replace Predis.ai Logo in the SDK. This will take effect only with the Whitelabel SDK Addon available in the SDK pricing. | String | no |
downloadHidden | Pass true to hide the Download button in the SDK library page and inside the editor. This is defaulted to false. | String | no |
publishHidden | Pass true to hide the Publish button in the SDK library page and inside the editor. This is defaulted to false. | String | no |
combinePublishAndDownloadVisible | Pass true to show the combined "Download & publish" button. This basically combines both features. This is defaulted to false. | String | no |
closeOnPublish | Pass false to stop closing of SDK on clicking of publish button. This is used for cases where you want your users to close the SDK manually instead of doing it automatically. This is defaulted to true. | String | no |